package com.sfh.dog.adapter;

import com.sfh.dog.ui.fragment.FastFragment;
import com.sfh.dog.ui.fragment.HotFragment;
import com.sfh.dog.ui.fragment.MainFragment;
import com.sfh.dog.ui.fragment.UserFragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

/**
 * 主页右侧适配
 * @author sWX229906
 *
 */
public class MainViewPageAdapter extends FragmentStatePagerAdapter
{
    
    public MainViewPageAdapter(FragmentManager fm)
    {
        super(fm);
    }

    @Override
    public Fragment getItem(int arg0)
    {
        Fragment fragment = null;
        switch (arg0)
        {
            case 0:
            {  
                fragment = new MainFragment();
                break;
            }
            case 1:
            {  
                fragment = new UserFragment();
                break;
            }
            case 2:
            {  
                fragment = new HotFragment();
                break;
            }
            case 3:
            {  
                fragment = new FastFragment();
                break;
            }
            default:
                break;
        }
        return fragment;
    }
    
    @Override
    public int getCount()
    {
        return 4;
    }
    
}
